AnnieRoot.shootPeople= AnnieRoot.shootPeople||{};
AnnieRoot.shootPeople.MonsterManager=class extends annie.Sprite{
	constructor() {
		super();
		let s=this;
		/*_a2x_need_start*//*_a2x_need_end*/
		annie.initRes(s,"shootPeople","MonsterManager");
	}

	/*获取恶魔方法*/
	static getEnemy  () {
		var s = this,
			enemy;
		if (s.enemyPool.length > 0) {
			enemy = s.enemyPool.shift();
		} else {
			enemy =annie.getDisplay("shootPeople","Monster");//生成小恶魔
		}
		return enemy;//返回小恶魔类实例
	};
	/**
	 * 恶魔回收
	 * @param enemy
	 */
	static recoveryEnemy(enemy, type) {
		var s = this;
		if (!enemy) {
			throw new Error('enemy参数不能为空');
		}
		if(type){
			if (!enemy["" + type].hasEventListener(annie.Event.END_FRAME)) {
				enemy["" + type].addEventListener(annie.Event.END_FRAME, function (e) {
					enemy.visible = false;
					enemy.gotoAndStop(1);
					enemy.motion = "";
					s.enemyPool.push(enemy);
				})
			}
		}else{
			enemy.visible = false;
			enemy.gotoAndStop(1);
			enemy.motion = "";
			s.enemyPool.push(enemy);
		}
	};
};
AnnieRoot.shootPeople.MonsterManager.enemyPool = [];//恶魔池